package com.amit.Basic_Simple_Program;

import java.util.Scanner;

public class SearchElement_inArray {

	public static void main(String[] args) {
		int i;
		int a[]={23,45,34,87};
		System.out.println("Enter the element for search");
		Scanner sc=new Scanner(System.in);
		int search=sc.nextInt();
		
		for( i=0;i<=a.length-1;i++) 
		{
			if(a[i]==search)
			{
				System.out.println(search+" "+"is present at location"+" " +i);
				break;
			}
			
		}
		
		if(i==a.length)
		{
			System.out.println(search+" "+" is not present");
		}
		
		

	}

}
